<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
    <body style="background: white;">
	  <p:dataList var="file" value="#{HomeworkBean.targetAnswer.files}">
		<p:column>
		    <h:panelGrid columns="1">
                        <p:commandLink ajax="false" value="İndir (#{file.file.name})">
				    <f:setPropertyActionListener value="#{file.file}" target="#{HomeworkBean.targetFile}"/>
				    <p:fileDownload value="#{HomeworkBean.convert()}"/>
				</p:commandLink>
				    <h:outputLabel value="Açıklama: #{file.information}"/>
		    </h:panelGrid>
		</p:column>
	  </p:dataList>
	  <h:panelGrid columns="2">
		<h:outputLabel value="Cevaplayan Öğrenci: "/>
		<p:commandLink value="#{HomeworkBean.targetAnswer.student.fullName}" action="#{HomePageBean.clickStudent()}">
		    <f:setPropertyActionListener value="#{HomeworkBean.targetAnswer.student}" target="#{StudentBean.target}"/>
		</p:commandLink>
		<h:outputLabel rendered="#{HomeworkBean.answersTeacher()}" value="Puan: "/>
		<p:inputText rendered="#{HomeworkBean.answersTeacher()}" value="#{HomeworkBean.score}"/>
		<p:commandButton rendered="#{HomeworkBean.answersTeacher()}" value="Puanlandır" action="#{HomeworkBean.giveScore()}" ajax="false"/>
		<h:outputLabel rendered="#{HomeworkBean.error==false}" value="#{HomeworkBean.message}"/>
	  </h:panelGrid>
    </body>
</html>
